
//在background中监听content请求
chrome.extension.onMessage.addListener(function(request, sender, callback){

    //发起异步请求
    $.ajax(request).then(function ($data) {
        callback({code: 200,data:$data,msg:''});
    },function ($e) {
        callback({code:$e.status,msg:$e.statusText,data:{}});
    });

    return true;
});